package com.zhongkai.model3;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;

@Entity
@Table(name = "son_user",    catalog = "")
public class SonUser implements Serializable {
    private Long id;
    private String forUuid;
    private String forPhone;
    private String sonUuid;
    private String sonPhone;
    private String relation;
    private Long sTime;
    private String remove;
    private AppBetween appBetweenByRelation;

    @Id
    @Column(name = "id")
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "for_uuid")
    public String getForUuid() {
        return forUuid;
    }

    public void setForUuid(String forUuid) {
        this.forUuid = forUuid;
    }

    @Basic
    @Column(name = "for_phone")
    public String getForPhone() {
        return forPhone;
    }

    public void setForPhone(String forPhone) {
        this.forPhone = forPhone;
    }

    @Basic
    @Column(name = "son_uuid")
    public String getSonUuid() {
        return sonUuid;
    }

    public void setSonUuid(String sonUuid) {
        this.sonUuid = sonUuid;
    }

    @Basic
    @Column(name = "son_phone")
    public String getSonPhone() {
        return sonPhone;
    }

    public void setSonPhone(String sonPhone) {
        this.sonPhone = sonPhone;
    }

    @Basic
    @Column(name = "relation")
    public String getRelation() {
        return relation;
    }

    public void setRelation(String relation) {
        this.relation = relation;
    }

    @Basic
    @Column(name = "s_time")
    public Long getsTime() {
        return sTime;
    }

    public void setsTime(Long sTime) {
        this.sTime = sTime;
    }

    @Basic
    @Column(name = "remove")
    public String getremove() {
        return remove;
    }

    public void setremove(String remove) {
        this.remove = remove;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SonUser sonUser = (SonUser) o;
        return Objects.equals(id, sonUser.id) &&
                Objects.equals(forUuid, sonUser.forUuid) &&
                Objects.equals(forPhone, sonUser.forPhone) &&
                Objects.equals(sonUuid, sonUser.sonUuid) &&
                Objects.equals(sonPhone, sonUser.sonPhone) &&
                Objects.equals(relation, sonUser.relation) &&
                Objects.equals(sTime, sonUser.sTime) &&
                Objects.equals(remove, sonUser.remove);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, forUuid, forPhone, sonUuid, sonPhone, relation, sTime, remove);
    }

    @ManyToOne
    @JoinColumn(name = "relation", referencedColumnName = "id", nullable = false,insertable = false, updatable = false)
    public AppBetween getAppBetweenByRelation() {
        return appBetweenByRelation;
    }
    public void setAppBetweenByRelation(AppBetween appBetweenByRelation) {
        this.appBetweenByRelation = appBetweenByRelation;
    }
}
